package top.ucat.boots.starter.oauth2.server.utils;

import top.ucat.boots.starter.oauth2.client.beans.oauth.OauthToken;
import top.ucat.boots.starter.oauth2.client.beans.oauth.OauthTokenDto;
import top.ucat.boots.starter.oauth2.client.beans.oauth.login.QRLoginDto;
import top.ucat.boots.starter.oauth2.server.manager.Subject;

/**
 * @Auther: Jun
 * @Date: 2019/9/4 10:37
 * @Description:
 */
public class SubjectUtils {

    private Subject subject;

    private SubjectUtils() {
    }

    public static Subject getSubject() {
        return Subject.getInstance();
    }

    public static OauthToken qrLogin(QRLoginDto dto) {
        return getSubject().getScanQRSsoFactory().login(dto);
    }

    public static OauthToken defaultLogin(OauthTokenDto dto) {
        return getSubject().getDefaultLoginFactory().login(dto);
    }


//    public static Object qrRegisterUser(String userId, String userCode, String userCodeType, String systemType) {
//        return getSubject().getScanQRSsoFactory().registerUserCredentials(userId, userCode, userCodeType, systemType);
//    }
}
